<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function checkLogin($user, $pass) {
    $db = new mysqli("localhost", "rmplanne_andrew", "Pi39RQ", "rmplanne_rmplanner");
    $results = $db->query("SELECT user_id FROM users WHERE user_login='" . $user . "' AND user_password='" . $pass . "'");
    $db->commit();
    
    if ($row = $results->fetch_assoc())
        echo $row["user_id"];
    else
        echo "0";
    $db->close();
}

checkLogin($_POST["user"], $_POST["pass"]);
?>
